package com.zb.automation.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author ZhangBin
 * @Date 2022/7/23 14:01
 * @Description 常用的请求方式
 */
@Getter
@AllArgsConstructor
public enum RequestMethodEnum {

    POST("post", "POST"),

    GET("get", "GET"),

    PUT("put", "PUT"),

    DELETE("delete", "DELETE");

    private String type;
    private String desc;

    public static RequestMethodEnum getInstance(String type) {
        for (RequestMethodEnum requestMethodEnum : RequestMethodEnum.values()) {
            if (requestMethodEnum.getType().equals(type)){
                return requestMethodEnum;
            }
        }
        return null;
    }
}
